/**
 * Created by Administrator on 2017/5/25.
 */
function scroll() {
    if(window.pageYOffset){
        return {
            left : window.pageXOffset,
            top : window.pageYOffset
        }
    }else if (document.compatMode == "CSS1Compat"){
        return {
            left : document.documentElement.scrollLeft,
            top : document.documentElement.scrollTop
        }
    }

    return {
        left : document.body.scrollLeft,
        top : document.body.scrollTop
    }
}